package com.jd.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jd.basic.domain.BaseDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 小林同学
 * @version 1.0
 * @description: 部门表
 * @date 2023/2/18 17:29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    /**
     * `id` bigint(20) NOT NULL AUTO_INCREMENT,
     *   `sn` varchar(255) DEFAULT NULL COMMENT '部门编号',
     *   `name` varchar(255) DEFAULT NULL COMMENT '部门名称',
     *   `dirPath` varchar(255) DEFAULT NULL COMMENT '部门的上级分类层级id',
     *   `state` int(20) DEFAULT NULL COMMENT '部门状态 1启用，0禁用',
     *   `manager_id` bigint(20) DEFAULT NULL COMMENT '部门管理员，关联Employee表id',
     *   `parent_id` bigint(20) DEFAULT NULL COMMENT '上级部门'
     * @author kabuda
     * @date 2023/2/18 17:30

    */

    private String sn;

    private String name;

    private String dirPath;

    private Integer state;

    private Long managerId;

    private Long parentId;

    private Employee manager;

    private Department parent;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();

}
